<template>
  <div>
    <ul>
      <li v-for="item in subjectsList" :key="item._id">
        {{ item.name }}
      </li>
    </ul>
    <div>
        {{showInfo}}
    </div>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const {
  mapActions: mapSubjectsActions,
  mapState: mapSubjectsState,
  mapGetters: mapSubjectsGetters,
} = createNamespacedHelpers("subjects");
export default {
  methods: {
    ...mapSubjectsActions({ sa: "getAllSubjectsAsync" }),
  },
  computed: {
    ...mapSubjectsState({ subjectsList: "subjects" }),
    ...mapSubjectsGetters(["showInfo"]),
  },
  created() {
    this.sa();
  },
};
</script>

<style>
</style>